SuperStrict

Import maxgui.drivers
Import "Scintilla/Scintilla.bmx"
Rem
Type TScintillaGadget Extends TWindowsGadget
	
	Field _oldSelPos% , _oldSelLen% = 0
	Field readonly:Byte = False ;
	Field numbers:Byte = False;
	Global _pagemargin# = 0.5
	
	Function Create:TScintillaGadget(x:Int = 0 , y:Int = 0 , w:Int = - 1 , h:Int = - 1 , group:TGadget = Null, flags:Int = 0)
		Local ctrl:TScintillaGadget = New TScintillaGadget
				
		If w = -1 And h = -1 Then
			ctrl._hwnd = CreateWindowExA( WS_EX_CLIENTEDGE , "Scintilla" , "" , WS_CHILD | WS_VISIBLE , ..
	                              x,y, ClientWidth(group),ClientHeight(group) , ..
	                              QueryGadget(group , QUERY_HWND) , 0 , GetModuleHandleA(Null) , "")
	
					ctrl.SetShape(x,y, ClientWidth(group),ClientHeight(group) )
		Else
			ctrl._hwnd = CreateWindowExA( WS_EX_CLIENTEDGE , "Scintilla" , "" , WS_CHILD | WS_VISIBLE , ..
	                              x,y,w,h , ..
	                              QueryGadget(group , QUERY_HWND) , 0 , GetModuleHandleA(Null) , "")
					ctrl.SetShape(x,y,w,h)
		End If
		
		ctrl._setparent(group)
		ctrl._hwndclient =  QueryGadget(group,QUERY_HWND_CLIENT)
				
		SetParent_(ctrl._HWND , QueryGadget(group,QUERY_HWND))
	
		ctrl.Register GADGET_WINDOW,ctrl._hwnd,Null,False'ctrl._hwndclient,False
		 ctrl.SendEditor (SCI_SETMODEVENTMASK , SC_MODEVENTMASKALL)
	
		Return ctrl

	End Function
End Rem
	
Type TScintillaGadget Extends TWindowsGadget
	
	Field _oldSelPos% , _oldSelLen% = 0
	Field readonly:Byte = False
	Field numbers:Byte = False
	Global _pagemargin# = 0.5
	
	Function Create:TScintillaGadget(x:Int = 0 , y:Int = 0 , w:Int = - 1 , h:Int = - 1 , group:TGadget = Null, style:Int = 0)
		
		If w = -1 Then w = ClientWidth(group)-x
		If h = -1 Then h = ClientHeight(group)-y
		Return New TScintillaGadget.Initialize(x,y,w,h,group,style)
		
	End Function
	
	Method Initialize:TScintillaGadget(x:Int, y:Int, w:Int, h:Int, group:TGadget, style:Int)
	
		Local	wstyle:Int, hwnd:Int, parent:Int
		
		Self.style = style
		wstyle=WS_CHILD|WS_TABSTOP|WS_CLIPSIBLINGS
		parent=group.query(QUERY_HWND_CLIENT)
		hwnd=CreateWindowExW(0,"Scintilla","",wstyle,0,0,0,0,parent,0,GetModuleHandleW(Null),Null)				
		Register GADGET_TEXTAREA,hwnd
		
		_SetParent group
		SetShape(x,y,w,h)
		SetShow(True)
		Sensitize()
		
		SendEditor (SCI_SETMODEVENTMASK , SC_MODEVENTMASKALL)
		
		Return Self		
		
	EndMethod
	
	Method OnNotify:Int(wp:Int,lp:Int)
		Local nmhdr:Int Ptr
		Local event:TEvent
				
		nmhdr = Int Ptr(lp)
			
		Local notification:SCNotification = New SCNotification
		MemCopy Byte Ptr notification , nmhdr , SizeOf(notification)
		
		Local L:TScintillaEventData = TScintillaEventData.From(notification)
		
		If ScintillaSCNToString(notification.Code) <> "Unknown" Then
			.PostGuiEvent EVENT_GADGETACTION , Self , L.Code , ,,, L
		End If			
			
	EndMethod
	
	Method WndProc:Int(hwnd:Int,msg:Int,wp:Int,lp:Int)
	
		
		Local nmhdr:Int Ptr
		Local event:TEvent
		
		nmhdr = Int Ptr(wp)
		
		'If wp = 0 Then Return 0
		
		Select MSG
			Case WM_RBUTTONDOWN
				If GetSelectionLength(TEXTAREA_CHARS)=0 MSG=WM_LBUTTONDOWN
			Case WM_RBUTTONUP
				
				Local mx:Int=lp & $ffff
				Local my:Int = lp Shr 16
				Print "MENU : " + mx + "; " + my + "; " '+ Chr(wp)
				.PostGuiEvent EVENT_GADGETMENU,Self,0,0,mx,my
			Case WM_KEYDOWN
				Local k:Int=wp'nmhdr[4]
				'Event Filter
				event = CreateEvent(EVENT_KEYDOWN , Self , k , keymods() )
				If eventfilter <> Null
					Return Not eventfilter(event , context)
				EndIf

			Case WM_CHAR
				If readonly Return 1
				event=CreateEvent(EVENT_KEYCHAR,Self,wp,keymods())
				If eventfilter<>Null
					Return Not eventfilter(event , context)
				EndIf
		End Select
	EndMethod
	
	Method KeyMods:Int()
		Local mods:Int
		If GetKeyState(VK_SHIFT)&$8000 mods:|MODIFIER_SHIFT
		If GetKeyState(VK_CONTROL)&$8000 mods:|MODIFIER_CONTROL
		If GetKeyState(VK_MENU)&$8000 mods:|MODIFIER_OPTION
		If GetKeyState(VK_LWIN)&$8000 Or GetKeyState(VK_RWIN)&$8000 mods:|MODIFIER_SYSTEM
		Return mods
	End Method


	Method SendEditor:Int(Msg:Int , wParam:Int = 0 , lParam:Int = 0)
		Return SendMessageW(_hwnd , msg , wparam , lParam)
	End Method
	
	Method SendEditorString:Int(msg:Int , wParam:Int , lParam:String)
		Local p:Byte Ptr = lparam.toCString()
		Return SendEditor(msg , wParam , Int p)
	End Method
	
	Method SendEditorStringString:Int(msg:Int , wParam:String , lParam:String)
		Local w:Byte Ptr = wparam.toCString()
		Local l:Byte Ptr = lparam.toCString()
		Return SendEditor(msg , Int w , Int l)
	End Method
	
	Method GetEditorString:String(msg:Int , Length:Int )
		Local chars:Byte[] = New Byte[length]
		SendEditor(msg , length, Int Byte Ptr(chars) )
		Local text:String = ""
		If length > 1
			text = String.FromBytes(chars,length-1)
		End If
			
		Return text.Replace(Chr(13),Chr(10))
	End Method

	Method SetText(text$)
		Local p:Byte Ptr = text.toCString()
		SendEditor(SCI_SETTEXT , 0 , Int p)
	EndMethod

	Method GetText$()
		Return AreaText(0,charcount(),TEXTAREA_CHARS)
	EndMethod
	
	Method AreaText$(pos:Int , length:Int , units:Int)
		Local range:TextRange = New TextRange
		'range.chrg = New CharacterRange
		If length < 0 Then length = charcount()
		
		If units = TEXTAREA_LINES Then
			range.cpmin = CharAt(pos)
			range.cpmax = CharAt(pos + Length+1)
		Else
			range.cpmin = pos
			range.cpmax = pos+Length
		End If
		
		range.lpstrText = New Byte[range.cpmax - range.cpmin+1]
				
		Local tmpLength:Int =  SendEditor(SCI_GETTEXTRANGE ,0 , Int Byte Ptr range)
		
		'Print "Test : " + tmplength + " ; " + (range.cpmax - range.cpmin)
		
		Local text:String = String.FromCString(Byte Ptr(range.lpstrText))
			
		Return text
	EndMethod

	Method Class:Int()
		Return GADGET_TEXTAREA
	End Method

	Method SetLineNumbering(Margin:Int = 0,State:Int = 0)
		SendEditor(SCI_SETMARGINTYPEN , Margin , SC_MARGIN_NUMBER)
		If State = True Then
			SendEditor(SCI_SETMARGINWIDTHN , Margin , SendEditorString(SCI_TEXTWIDTH , 0 , "_99999") )
			numbers= True
		Else
			SendEditor(SCI_SETMARGINWIDTHN , Margin , 0 )
			numbers = False
		End If
	End Method
	
	Method SetLexer(Lexer:Int = SCLEX_NULL)
		SendEditor(SCI_SETLEXER,Lexer)
	End Method
	
	Method GetLexer:Int()
		Return SendEditor(SCI_GETLEXER)
	End Method
	
	Method SetLexerKeyWords(Set:Int = 0, Keywords:String)
		SendEditorString(SCI_SETKEYWORDS,Set , KeyWords)
	End Method

	Method SetLexerStyle(Style:Int , target:Int , value:Int = 0)
		SendEditor(Style,target,value)
	End Method
	
	Method SetMarginType(Margin:Int = 0 , Style:Int , Width:Int = 0)
		SendEditor(SCI_SETMARGINTYPEN , Margin , Style)
		SendEditor(SCI_SETMARGINWIDTHN, Margin, Width)
	End Method
	
	Method SetMarginSensitive(Margin:Int , sens:Int = False)
		SendEditor(SCI_SETMARGINSENSITIVEN, margin,sens)
	End Method
	
	Method SetProperty(property:String , value:String)
		SendEditorStringString(SCI_SETPROPERTY, property, value)
	End Method
	
	Method Free()
		Super.Free()
	EndMethod
	
	Method Activate:Int(cmd:Int)
		Select cmd
			Case ACTIVATE_CUT	
				SendEditor(SCI_CUT)
			Case ACTIVATE_COPY	
				SendEditor(SCI_COPY)
			Case ACTIVATE_PASTE
				DoPaste	
			Case ACTIVATE_PRINT
				DoPrint
			Case ACTIVATE_FOCUS
				SetFocus _hwnd
			Default
				Return Super.Activate(cmd)
		End Select
	EndMethod
	
	Method DoPaste()
		SendEditor(SCI_PASTE)
	EndMethod
	
	Method DoPrint:Int()
		
		Local tmpTextSelLen:Int = TextAreaSelLen(Self)
		
		Local tmpPrintDialog:PRINTDLGW = New PRINTDLGW
		
		tmpPrintDialog.flags = PD_RETURNDC | PD_HIDEPRINTTOFILE | PD_NOPAGENUMS
		If Not tmpTextSelLen Then tmpPrintDialog.flags:|PD_NOSELECTION
		
		tmpPrintDialog.hwndOwner = _hwnd
		
		If Not PrintDlg( Byte Ptr tmpPrintDialog ) Then Return 0
		
		Local hdcPrinter:Int = tmpPrintDialog.hdc	
		
		Local tmpDoc:DOCINFOW = New DOCINFOW
		Local tmpDocTitle:Short Ptr = AppTitle.ToWString()
		tmpDoc.lpszDocName = tmpDocTitle
		
		Local tmpSuccess:Int = (StartDocW( hdcPrinter, Byte Ptr tmpDoc ) > 0)
		
		If tmpSuccess Then
			
			Local _cursor:Int = TWindowsGUIDriver._cursor
			
			SetPointer( POINTER_WAIT )
			
			SetMapMode( hdcPrinter, MM_TEXT )
			
			Local wPage:Int = GetDeviceCaps( hdcPrinter, PHYSICALWIDTH )
			Local hPage:Int = GetDeviceCaps( hdcPrinter, PHYSICALHEIGHT )
			Local xPPI:Int = GetDeviceCaps( hdcPrinter, LOGPIXELSX )
			Local yPPI:Int = GetDeviceCaps( hdcPrinter , LOGPIXELSY )
			Local Margin:Rect = New Rect
			Margin.x1 = GetDeviceCaps(hdcPrinter, PHYSICALOFFSETX)
			margin.y1 = GetDeviceCaps(hdcPrinter, PHYSICALOFFSETY)
			margin.x2 = wPage - GetDeviceCaps(hdcPrinter, HORZRES) - margin.x1 ; 	
			margin.y2 = hPage - GetDeviceCaps(hdcPrinter, VERTRES) - margin.y1 ; 	
			
			Print margin.x1 + "; " + margin.y1 + " ;" + margin.x2 + ";" + margin.y2

			'Local tmpTextLengthStruct[] = [GTL_DEFAULT,1200]
			'Local tmpTextLength = SendMessageW (_hwnd, EM_GETTEXTLENGTHEX, Int Byte Ptr tmpTextLengthStruct, 0)
			
			Local tmpTextPrinted:Int, tmpFormatRange:RangeToFormat = New RangeToFormat 
			
			tmpFormatRange.hdc = hdcPrinter
			tmpFormatRange.hdcTarget = hdcPrinter
			
			'tmpFormatRange.rcPageRight = (wPage*1440:Long)/xPPI
			'tmpFormatRange.rcPageBottom = (hPage*1440:Long)/yPPI
			
			'tmpFormatRange.range.rc.x1 = (1440*_pagemargin);tmpFormatRange.rcTop = (1440*_pagemargin)
			'tmpFormatRange.range.rc.y1 = tmpFormatRange.rcPageRight - (2880*_pagemargin)
			'tmpFormatRange.rcBottom = tmpFormatRange.rcPageBottom - (2880*_pagemargin)
	
			tmpFormatRange.rc = New Rect
			tmpFormatRange.rcPage = New Rect
			
			tmpFormatRange.rcPage.x2 = (wPage*1440:Long)/xPPI
			tmpFormatRange.rcPage.y2 = (hPage*1440:Long)/yPPI
			
			tmpFormatRange.rc.x1 = (1440*_pagemargin);
			tmpFormatRange.rc.y1 =  (1440*_pagemargin)
			tmpFormatRange.rc.x2 = tmpFormatRange.rcPage.x2 - (2880*_pagemargin)
			tmpFormatRange.rc.y2 = tmpFormatRange.rcPage.y2 - (2880*_pagemargin)

			tmpFormatRange.rcPage.x1 = 0
			tmpFormatRange.rcPage.y1 = 0
			
				
			If tmpPrintDialog.flags & PD_SELECTION Then
				tmpFormatRange.chrg = New CharacterRange
				tmpFormatRange.chrg.cpmin = SendEditor(SCI_GETSELECTIONSTART)
				tmpFormatRange.chrg.cpmax = SendEditor(SCI_GETSELECTIONEND)

			Else
				tmpFormatRange.chrg = New CharacterRange
				tmpFormatRange.chrg.cpmin = 0
				tmpFormatRange.chrg.cpmax = SendEditor(SCI_GETTEXTLENGTH)
			EndIf
			
			Print SendEditor(SCI_FORMATRANGE, False, 0)
			
			While tmpSuccess And ( tmpTextPrinted < tmpFormatRange.chrg.cpmax  )
				
				tmpFormatRange.chrg.cpMin = tmpTextPrinted
				
				tmpSuccess = (StartPage(hdcPrinter) > 0)
				If Not tmpSuccess Then Exit
				
				tmpTextPrinted = SendEditor(SCI_FORMATRANGE , True , Int Byte Ptr tmpFormatRange) ;
				'tmpTextPrinted = SendMessageW( _hwnd, EM_FORMATRANGE, True, Int Byte Ptr tmpFormatRange )
				Print "Printed " +  tmpTextPrinted
				tmpSuccess = (EndPage(hdcPrinter) > 0)
				
				'tmpTextPrinted = SendEditor(SCI_GETTEXTLENGTH)
			Wend
			
			If tmpSuccess Then EndDoc( hdcPrinter ) Else AbortDoc( hdcPrinter )
			
			SendEditor(SCI_FORMATRANGE, False, 0)
			
			TWindowsGUIDriver._cursor = _cursor
			SetCursor _cursor
			
		EndIf
		
		GlobalFree( tmpPrintDialog.hDevMode )
		GlobalFree( tmpPrintDialog.hDevNames )
		DeleteDC( hdcPrinter )
		
		MemFree tmpDocTitle
		
		Return tmpSuccess
				
	EndMethod
	
	Method CharCount:Int()
		Return SendEditor(SCI_GETTEXTLENGTH)
	EndMethod
	
	Method SetStyle(r:Int , g:Int , b:Int , flags:Int , pos:Int , length:Int , units:Int)
	
	EndMethod	
	
	Method SetFont(font:TGuiFont)
		Local _font:TWindowsFont
		If TWindowsFont(font) Then _font = TWindowsFont(font) Else _font = TWindowsGUIDriver.GDIFont
		DebugStop()
		Rem
		Const FONT_NORMAL=0
		Const FONT_BOLD=1
		Const FONT_ITALIC=2
		Const FONT_UNDERLINE=4
		Const FONT_STRIKETHROUGH=8
		End Rem
		Print "Style : " + _font.Style + ";" +( (_font.Style & FONT_BOLD) >0)
		For Local I:Int = 0 To 99
			SendEditorString(SCI_STYLESETFONT , I , _Font.name)
			SetLexerStyle(SCI_STYLESETSIZE , I , Int(_Font.Size) )
			SetLexerStyle(SCI_STYLESETBOLD, I, (_font.Style & FONT_BOLD) >0)
			SetLexerStyle(SCI_STYLESETITALIC, I, (_font.Style & FONT_ITALIC) >0)
			SetLineNumbering(0,True)	
		Next
	End Method
		
	Method InsertText(text$ , pos:Int , count:Int)
		SendEditorString(SCI_INSERTTEXT,pos,text)
	EndMethod
	
	Method ReplaceText(pos:Int , length:Int , text$ , units:Int)
		If units=TEXTAREA_LINES
			Local n:Int=pos
			pos=CharAt(pos)
			If length>=0 length=CharAt(n+length)-pos
		EndIf			
		If length < 0 Then length = charcount() - pos	
		Print pos + ";"+ (pos + length)
		SendEditor(SCI_SETTARGETSTART , pos)
		SendEditor(SCI_SETTARGETEND , pos + Length)
		SendEditorString(SCI_REPLACETARGET, text.length, text)
		.SelectTextAreaText Self,0,0,TEXTAREA_LINES
	EndMethod

	
	Method SetSelection(pos:Int,length:Int,units:Int)
		If units=TEXTAREA_LINES
			Local n:Int=pos
			pos=CharAt(pos)
			If length>=0 length=CharAt(n+length)-pos
		EndIf			
		If length < 0 Then length = charcount() - pos	
		Desensitize()
		SendEditor(SCI_GOTOPOS,pos)
		SendEditor(SCI_SETSELECTIONSTART , pos)
		SendEditor(SCI_SETSELECTIONEND , pos + length)
		Sensitize()
	EndMethod

	Method SetTabs(tabs:Int)
		SendEditor(SCI_SETTABWIDTH,tabs)
	EndMethod

	Method SetTextColor(r:Int , g:Int , b:Int)
		SetLexerStyle(SCI_STYLESETFORE , 0, EncodeColor(r , g , b) )
	EndMethod

	Method SetColor(r:Int,g:Int,b:Int)
		SetLexerStyle(SCI_STYLESETBACK , STYLE_DEFAULT , EncodeColor(r , g , b) )
		SetLexerStyle(SCI_STYLESETBACK , 0 , EncodeColor(r , g , b) )
	EndMethod
	
	
	Method GetCursorPos:Int(units:Int)
		Local pos:Int = SendEditor(SCI_GETSELECTIONSTART)'SendEditor(SCI_GETCURRENTPOS)
		If units = TEXTAREA_LINES Then
			Return LineAT(pos)
		End If
		Return pos
	EndMethod	
	
	Method GetSelectionLength:Int(units:Int)
		Local cpMin:Int = SendEditor(SCI_GETSELECTIONSTART)
		Local cpMax:Int = SendEditor(SCI_GETSELECTIONEND)
		If units=TEXTAREA_LINES 
			Return LineAt(cpMax)-LineAt(cpMin)-1
		Else
			Return cpMax-cpMin
		EndIf
	EndMethod

	Method CharAt:Int(line:Int)
		If line<0 Return 0
		If line>AreaLen(TEXTAREA_LINES) Return charcount()
		Return SendEditor(SCI_POSITIONFROMLINE,line,0)
	EndMethod

	Method LineAt:Int(pos:Int)
		If pos<0 Return 0
		If pos>charcount() Return AreaLen(TEXTAREA_LINES)
		Return SendEditor(SCI_LINEFROMPOSITION,pos)
	EndMethod

	Method AreaLen:Int(units:Int)
		If units=TEXTAREA_LINES Return LineAt(charcount())
		Return charcount()
	EndMethod
	
	Method CharX:Int( char:Int )
		Return SendEditor(SCI_POINTXFROMPOSITION,0,char)
	EndMethod
	
	Method CharY:Int( char:Int )
		Return SendEditor(SCI_POINTYFROMPOSITION,0,char)
	EndMethod
	
	Method AddText(text$)
		SendEditorString(SCI_APPENDTEXT,text.length,text)
	EndMethod
	
	Rem
	Start of OOP Scintilla interface
	End Rem
	
	'Text Retrieval and modification
	Rem
	SCI_GETTEXT(int length, char *text)
	SCI_SETTEXT(<unused>, const char *text)
	SCI_SETSAVEPOINT
	SCI_GETLINE(int line, char *text)
	SCI_REPLACESEL(<unused>, const char *text)
	SCI_SETREADONLY(bool readOnly)
	SCI_GETREADONLY
	SCI_GETTEXTRANGE(<unused>, TextRange *tr)
	SCI_ALLOCATE(int bytes, <unused>)
	SCI_ADDTEXT(int length, const char *s)
	SCI_ADDSTYLEDTEXT(int length, cell *s)
	SCI_APPENDTEXT(int length, const char *s)
	SCI_INSERTTEXT(int pos, const char *text)
	SCI_CLEARALL
	SCI_CLEARDOCUMENTSTYLE
	SCI_GETCHARAT(int position)
	SCI_GETSTYLEAT(int position)
	SCI_GETSTYLEDTEXT(<unused>, TextRange *tr)
	SCI_SETSTYLEBITS(int bits)
	SCI_GETSTYLEBITS
	SCI_TARGETASUTF8(<unused>, char *s)
	SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)
	SCI_SETLENGTHFORENCODE(Int bytes)
	End Rem

	Method SciGetText:String(length:Int)
		Return GetEditorString(SCI_GETTEXT,length)
	End Method
	
	Method SciSetText(text:String)
		SendEditorString(SCI_SETTEXT , 0 , text)
	End Method
	
	Method SciSetSavePoint()
		SendEditor(SCI_SETSAVEPOINT)
	End Method
	
	Method SciGetLine:String(line:Int)
		Return GetEditorString(SCI_GETLINE,line)
	End Method
	
	Method SciReplaceSel(text:String)
		SendEditorString(SCI_REPLACESEL , 0 , text)
	End Method
		
	Method SciAddtext(length:Int,text:String)
		SendEditorString(SCI_ADDTEXT,length,text)
	End Method
	
	Method SciAddstyledtext(length:Int,text:String)
		SendEditorString(SCI_ADDSTYLEDTEXT,length,text)
	End Method
	
	Method SciInserttext(pos:Int,text:String)
		SendEditorString(SCI_INSERTTEXT,pos,text)
	End Method
	
	Method SciClearall()
		SendEditor(SCI_CLEARALL)
	End Method
	
	Method SciCleardocumentstyle()
		SendEditor(SCI_CLEARDOCUMENTSTYLE)
	End Method
	
	Method SciGetlength:Int()
		Return SendEditor(SCI_GETLENGTH)
	End Method
	
	Method SciGetcharat:Int(pos:Int)
		Return SendEditor(SCI_GETCHARAT,pos)
	End Method
	
	Method SciGetcurrentpos:Int()
		Return SendEditor(SCI_GETCURRENTPOS)
	End Method
	
	Method SciGetanchor:Int()
		Return SendEditor(SCI_GETANCHOR)
	End Method
	
	Method SciGetstyleat:Int(pos:Int)
		Return SendEditor(SCI_GETSTYLEAT, pos)
	End Method
	
	Method SciRedo()
		SendEditor(SCI_REDO)
	End Method
	
	Method SciSetundocollection(state:Int)
		SendEditor(SCI_SETUNDOCOLLECTION,state)
	End Method
	
	Method SciSelectall()
		SendEditor(SCI_SELECTALL)
	End Method
	
	'Not implemnted
	Method SciGetstyledtext()
		SendEditor(SCI_GETSTYLEDTEXT)
	End Method
	
	Method SciCanredo:Int()
		Return SendEditor(SCI_CANREDO)
	End Method
	
	Method SciMarkerlinefromhandle:Int(handle:Int)
		Return SendEditor(SCI_MARKERLINEFROMHANDLE,handle)
	End Method
	
	Method SciMarkerdeletehandle(handle:Int)
		SendEditor(SCI_MARKERDELETEHANDLE, handle)
	End Method
	
	Method SciGetundocollection:Int()
		Return SendEditor(SCI_GETUNDOCOLLECTION)
	End Method
	
	Method SciGetviewws:Int()
		Return SendEditor(SCI_GETVIEWWS)
	End Method
	
	Method SciSetviewws(wsmode:Int)
		SendEditor(SCI_SETVIEWWS,wsmode)
	End Method
	
	Method SciPositionfrompoint:Int(x:Int,y:Int)
		Return SendEditor(SCI_POSITIONFROMPOINT,x,y)
	End Method
	
	Method SciPositionfrompointclose:Int(x:Int,y:Int)
		Return SendEditor(SCI_POSITIONFROMPOINTCLOSE)
	End Method
	
	Method SciGotoline(line:Int)
		SendEditor(SCI_GOTOLINE, line)
	End Method
	
	Method SciGotopos(pos:Int)
		SendEditor(SCI_GOTOPOS,pos)
	End Method
	
	Method SciSetanchor(pos:Int)
		SendEditor(SCI_SETANCHOR, pos)
	End Method
	
	Method SciGetcurline:Int()
		Return SendEditor(SCI_GETCURLINE)
	End Method
	
	Method SciGetendstyled:Int()
		Return SendEditor(SCI_GETENDSTYLED)
	End Method
	
	Method SciConverteols(eolMode:Int)
		SendEditor(SCI_CONVERTEOLS,eolMode)
	End Method
	
	Method SciGeteolmode:Int()
		Return SendEditor(SCI_GETEOLMODE)
	End Method
	
	Method SciSeteolmode(eolMode:Int)
		SendEditor(SCI_SETEOLMODE,eolMode)
	End Method
	
	Method SciStartstyling(pos:Int,mask:Int)
		SendEditor(SCI_STARTSTYLING,pos,mask)
	End Method
	
	Method SciSetstyling(length:Int,style:Int)
		SendEditor(SCI_SETSTYLING,length,style)
	End Method
	
	Method SciGetbuffereddraw:Int()
		Return SendEditor(SCI_GETBUFFEREDDRAW)
	End Method
	
	Method SciSetbuffereddraw(isbuffered:Int)
		SendEditor(SCI_SETBUFFEREDDRAW, isbuffered)
	End Method
	
	Method SciSettabwidth(width:Int)
		SendEditor(SCI_SETTABWIDTH, width)
	End Method
	
	Method SciGettabwidth:Int()
		Return SendEditor(SCI_GETTABWIDTH)
	End Method
	
	Method SciSetcodepage(codepage:Int)
		SendEditor(SCI_SETCODEPAGE, codepage)
	End Method
'break
	
	Method SciSetusepalette(allow:Int)
		SendEditor(SCI_SETUSEPALETTE, allow)
	End Method
	
	Method SciMarkerdefine(marker:Int, markersymbol:Int)
		SendEditor(SCI_MARKERDEFINE,marker,markersymbol)
	End Method
	
	Method SciMarkersetfore()
		SendEditor(SCI_MARKERSETFORE)
	End Method
	
	Method SciMarkersetback()
		SendEditor(SCI_MARKERSETBACK)
	End Method
	
	Method SciMarkeradd()
		SendEditor(SCI_MARKERADD)
	End Method
	
	Method SciMarkerdelete()
		SendEditor(SCI_MARKERDELETE)
	End Method
	
	Method SciMarkerdeleteall()
		SendEditor(SCI_MARKERDELETEALL)
	End Method
	
	Method SciMarkerget()
		SendEditor(SCI_MARKERGET)
	End Method
	
	Method SciMarkernext()
		SendEditor(SCI_MARKERNEXT)
	End Method
	
	Method SciMarkerprevious()
		SendEditor(SCI_MARKERPREVIOUS)
	End Method
	
	Method SciMarkerdefinepixmap()
		SendEditor(SCI_MARKERDEFINEPIXMAP)
	End Method
	
	Method SciMarkeraddset()
		SendEditor(SCI_MARKERADDSET)
	End Method
	
	Method SciMarkersetalpha()
		SendEditor(SCI_MARKERSETALPHA)
	End Method
	
	Method SciSetmargintypen()
		SendEditor(SCI_SETMARGINTYPEN)
	End Method
	
	Method SciGetmargintypen()
		SendEditor(SCI_GETMARGINTYPEN)
	End Method
	
	Method SciSetmarginwidthn()
		SendEditor(SCI_SETMARGINWIDTHN)
	End Method
	
	Method SciGetmarginwidthn()
		SendEditor(SCI_GETMARGINWIDTHN)
	End Method
	
	Method SciSetmarginmaskn()
		SendEditor(SCI_SETMARGINMASKN)
	End Method
	
	Method SciGetmarginmaskn()
		SendEditor(SCI_GETMARGINMASKN)
	End Method
	
	Method SciSetmarginsensitiven()
		SendEditor(SCI_SETMARGINSENSITIVEN)
	End Method
	
	Method SciGetmarginsensitiven()
		SendEditor(SCI_GETMARGINSENSITIVEN)
	End Method
	
	Method SciStyleclearall()
		SendEditor(SCI_STYLECLEARALL)
	End Method
	
	Method SciStylesetfore()
		SendEditor(SCI_STYLESETFORE)
	End Method
	
	Method SciStylesetback()
		SendEditor(SCI_STYLESETBACK)
	End Method
	
	Method SciStylesetbold()
		SendEditor(SCI_STYLESETBOLD)
	End Method
	
	Method SciStylesetitalic()
		SendEditor(SCI_STYLESETITALIC)
	End Method
	
	Method SciStylesetsize()
		SendEditor(SCI_STYLESETSIZE)
	End Method
	
	Method SciStylesetfont()
		SendEditor(SCI_STYLESETFONT)
	End Method
	
	Method SciStyleseteolfilled()
		SendEditor(SCI_STYLESETEOLFILLED)
	End Method
	
	Method SciStyleresetdefault()
		SendEditor(SCI_STYLERESETDEFAULT)
	End Method
	
	Method SciStylesetunderline()
		SendEditor(SCI_STYLESETUNDERLINE)
	End Method
	
	Method SciStylegetfore()
		SendEditor(SCI_STYLEGETFORE)
	End Method
	
	Method SciStylegetback()
		SendEditor(SCI_STYLEGETBACK)
	End Method
	
	Method SciStylegetbold()
		SendEditor(SCI_STYLEGETBOLD)
	End Method
	
	Method SciStylegetitalic()
		SendEditor(SCI_STYLEGETITALIC)
	End Method
	
	Method SciStylegetsize()
		SendEditor(SCI_STYLEGETSIZE)
	End Method
	
	Method SciStylegetfont()
		SendEditor(SCI_STYLEGETFONT)
	End Method
	
	Method SciStylegeteolfilled()
		SendEditor(SCI_STYLEGETEOLFILLED)
	End Method
	
	Method SciStylegetunderline()
		SendEditor(SCI_STYLEGETUNDERLINE)
	End Method
	
	Method SciStylegetcase()
		SendEditor(SCI_STYLEGETCASE)
	End Method
	
	Method SciStylegetcharacterset()
		SendEditor(SCI_STYLEGETCHARACTERSET)
	End Method
	
	Method SciStylegetvisible()
		SendEditor(SCI_STYLEGETVISIBLE)
	End Method
	
	Method SciStylegetchangeable()
		SendEditor(SCI_STYLEGETCHANGEABLE)
	End Method
	
	Method SciStylegethotspot()
		SendEditor(SCI_STYLEGETHOTSPOT)
	End Method
	
	Method SciStylesetcase()
		SendEditor(SCI_STYLESETCASE)
	End Method
	
	Method SciStylesetcharacterset()
		SendEditor(SCI_STYLESETCHARACTERSET)
	End Method
	
	Method SciStylesethotspot()
		SendEditor(SCI_STYLESETHOTSPOT)
	End Method
	
	Method SciSetselfore()
		SendEditor(SCI_SETSELFORE)
	End Method
	
	Method SciSetselback()
		SendEditor(SCI_SETSELBACK)
	End Method
	
	Method SciGetselalpha()
		SendEditor(SCI_GETSELALPHA)
	End Method
	
	Method SciSetselalpha()
		SendEditor(SCI_SETSELALPHA)
	End Method
	
	Method SciGetseleolfilled()
		SendEditor(SCI_GETSELEOLFILLED)
	End Method
	
	Method SciSetseleolfilled()
		SendEditor(SCI_SETSELEOLFILLED)
	End Method
	
	Method SciSetcaretfore()
		SendEditor(SCI_SETCARETFORE)
	End Method
	
	Method SciAssigncmdkey()
		SendEditor(SCI_ASSIGNCMDKEY)
	End Method
	
	Method SciClearcmdkey()
		SendEditor(SCI_CLEARCMDKEY)
	End Method
	
	Method SciClearallcmdkeys()
		SendEditor(SCI_CLEARALLCMDKEYS)
	End Method
	
	Method SciSetstylingex()
		SendEditor(SCI_SETSTYLINGEX)
	End Method
	
	Method SciStylesetvisible()
		SendEditor(SCI_STYLESETVISIBLE)
	End Method
	
	Method SciGetcaretperiod()
		SendEditor(SCI_GETCARETPERIOD)
	End Method
	
	Method SciSetcaretperiod()
		SendEditor(SCI_SETCARETPERIOD)
	End Method
	
	Method SciSetwordchars()
		SendEditor(SCI_SETWORDCHARS)
	End Method
	
	Method SciBeginundoaction()
		SendEditor(SCI_BEGINUNDOACTION)
	End Method
	
	Method SciEndundoaction()
		SendEditor(SCI_ENDUNDOACTION)
	End Method
	
	Method SciIndicsetstyle()
		SendEditor(SCI_INDICSETSTYLE)
	End Method
	
	Method SciIndicgetstyle()
		SendEditor(SCI_INDICGETSTYLE)
	End Method
	
	Method SciIndicsetfore()
		SendEditor(SCI_INDICSETFORE)
	End Method
	
	Method SciIndicgetfore()
		SendEditor(SCI_INDICGETFORE)
	End Method
	
	Method SciIndicsetunder()
		SendEditor(SCI_INDICSETUNDER)
	End Method
	
	Method SciIndicgetunder()
		SendEditor(SCI_INDICGETUNDER)
	End Method
	
	Method SciSetwhitespacefore()
		SendEditor(SCI_SETWHITESPACEFORE)
	End Method
	
	Method SciSetwhitespaceback()
		SendEditor(SCI_SETWHITESPACEBACK)
	End Method
	
	Method SciSetstylebits()
		SendEditor(SCI_SETSTYLEBITS)
	End Method
	
	Method SciGetstylebits()
		SendEditor(SCI_GETSTYLEBITS)
	End Method
	
	Method SciSetlinestate()
		SendEditor(SCI_SETLINESTATE)
	End Method
	
	Method SciGetlinestate()
		SendEditor(SCI_GETLINESTATE)
	End Method
	
	Method SciGetmaxlinestate()
		SendEditor(SCI_GETMAXLINESTATE)
	End Method
	
	Method SciGetcaretlinevisible()
		SendEditor(SCI_GETCARETLINEVISIBLE)
	End Method
	
	Method SciSetcaretlinevisible()
		SendEditor(SCI_SETCARETLINEVISIBLE)
	End Method
	
	Method SciGetcaretlineback()
		SendEditor(SCI_GETCARETLINEBACK)
	End Method
	
	Method SciSetcaretlineback()
		SendEditor(SCI_SETCARETLINEBACK)
	End Method
	
	Method SciStylesetchangeable()
		SendEditor(SCI_STYLESETCHANGEABLE)
	End Method
	
	Method SciAutocshow()
		SendEditor(SCI_AUTOCSHOW)
	End Method
	
	Method SciAutoccancel()
		SendEditor(SCI_AUTOCCANCEL)
	End Method
	
	Method SciAutocactive()
		SendEditor(SCI_AUTOCACTIVE)
	End Method
	
	Method SciAutocposstart()
		SendEditor(SCI_AUTOCPOSSTART)
	End Method
	
	Method SciAutoccomplete()
		SendEditor(SCI_AUTOCCOMPLETE)
	End Method
	
	Method SciAutocstops()
		SendEditor(SCI_AUTOCSTOPS)
	End Method
	
	Method SciAutocsetseparator()
		SendEditor(SCI_AUTOCSETSEPARATOR)
	End Method
	
	Method SciAutocgetseparator()
		SendEditor(SCI_AUTOCGETSEPARATOR)
	End Method
	
	Method SciAutocselect()
		SendEditor(SCI_AUTOCSELECT)
	End Method
	
	Method SciAutocsetcancelatstart()
		SendEditor(SCI_AUTOCSETCANCELATSTART)
	End Method
	
	Method SciAutocgetcancelatstart()
		SendEditor(SCI_AUTOCGETCANCELATSTART)
	End Method
	
	Method SciAutocsetfillups()
		SendEditor(SCI_AUTOCSETFILLUPS)
	End Method
	
	Method SciAutocsetchoosesingle()
		SendEditor(SCI_AUTOCSETCHOOSESINGLE)
	End Method
	
	Method SciAutocgetchoosesingle()
		SendEditor(SCI_AUTOCGETCHOOSESINGLE)
	End Method
	
	Method SciAutocsetignorecase()
		SendEditor(SCI_AUTOCSETIGNORECASE)
	End Method
	
	Method SciAutocgetignorecase()
		SendEditor(SCI_AUTOCGETIGNORECASE)
	End Method
	
	Method SciUserlistshow()
		SendEditor(SCI_USERLISTSHOW)
	End Method
	
	Method SciAutocsetautohide()
		SendEditor(SCI_AUTOCSETAUTOHIDE)
	End Method
	
	Method SciAutocgetautohide()
		SendEditor(SCI_AUTOCGETAUTOHIDE)
	End Method
	
	Method SciAutocsetdroprestofword()
		SendEditor(SCI_AUTOCSETDROPRESTOFWORD)
	End Method
	
	Method SciAutocgetdroprestofword()
		SendEditor(SCI_AUTOCGETDROPRESTOFWORD)
	End Method
	
	Method SciRegisterimage()
		SendEditor(SCI_REGISTERIMAGE)
	End Method
	
	Method SciClearregisteredimages()
		SendEditor(SCI_CLEARREGISTEREDIMAGES)
	End Method
	
	Method SciAutocgettypeseparator()
		SendEditor(SCI_AUTOCGETTYPESEPARATOR)
	End Method
	
	Method SciAutocsettypeseparator()
		SendEditor(SCI_AUTOCSETTYPESEPARATOR)
	End Method
	
	Method SciAutocsetmaxwidth()
		SendEditor(SCI_AUTOCSETMAXWIDTH)
	End Method
	
	Method SciAutocgetmaxwidth()
		SendEditor(SCI_AUTOCGETMAXWIDTH)
	End Method
	
	Method SciAutocsetmaxheight()
		SendEditor(SCI_AUTOCSETMAXHEIGHT)
	End Method
	
	Method SciAutocgetmaxheight()
		SendEditor(SCI_AUTOCGETMAXHEIGHT)
	End Method
	
	Method SciSetindent()
		SendEditor(SCI_SETINDENT)
	End Method
	
	Method SciGetindent()
		SendEditor(SCI_GETINDENT)
	End Method
	
	Method SciSetusetabs()
		SendEditor(SCI_SETUSETABS)
	End Method
	
	Method SciGetusetabs()
		SendEditor(SCI_GETUSETABS)
	End Method
	
	Method SciSetlineindentation()
		SendEditor(SCI_SETLINEINDENTATION)
	End Method
	
	Method SciGetlineindentation()
		SendEditor(SCI_GETLINEINDENTATION)
	End Method
	
	Method SciGetlineindentposition()
		SendEditor(SCI_GETLINEINDENTPOSITION)
	End Method
	
	Method SciGetcolumn()
		SendEditor(SCI_GETCOLUMN)
	End Method
	
	Method SciSethscrollbar()
		SendEditor(SCI_SETHSCROLLBAR)
	End Method
	
	Method SciGethscrollbar()
		SendEditor(SCI_GETHSCROLLBAR)
	End Method
	
	Method SciSetindentationguides()
		SendEditor(SCI_SETINDENTATIONGUIDES)
	End Method
	
	Method SciGetindentationguides()
		SendEditor(SCI_GETINDENTATIONGUIDES)
	End Method
	
	Method SciSethighlightguide()
		SendEditor(SCI_SETHIGHLIGHTGUIDE)
	End Method
	
	Method SciGethighlightguide()
		SendEditor(SCI_GETHIGHLIGHTGUIDE)
	End Method
	
	Method SciGetlineendposition()
		SendEditor(SCI_GETLINEENDPOSITION)
	End Method
	
	Method SciGetcodepage()
		SendEditor(SCI_GETCODEPAGE)
	End Method
	
	Method SciGetcaretfore()
		SendEditor(SCI_GETCARETFORE)
	End Method
	
	Method SciGetusepalette()
		SendEditor(SCI_GETUSEPALETTE)
	End Method
	
	Method SciGetreadonly()
		SendEditor(SCI_GETREADONLY)
	End Method
	
	Method SciSetcurrentpos()
		SendEditor(SCI_SETCURRENTPOS)
	End Method
	
	Method SciSetselectionstart()
		SendEditor(SCI_SETSELECTIONSTART)
	End Method
	
	Method SciGetselectionstart()
		SendEditor(SCI_GETSELECTIONSTART)
	End Method
	
	Method SciSetselectionend()
		SendEditor(SCI_SETSELECTIONEND)
	End Method
	
	Method SciGetselectionend()
		SendEditor(SCI_GETSELECTIONEND)
	End Method
	
	Method SciSetprintmagnification()
		SendEditor(SCI_SETPRINTMAGNIFICATION)
	End Method
	
	Method SciGetprintmagnification()
		SendEditor(SCI_GETPRINTMAGNIFICATION)
	End Method
	
	Method SciSetprintcolourmode()
		SendEditor(SCI_SETPRINTCOLOURMODE)
	End Method
	
	Method SciGetprintcolourmode()
		SendEditor(SCI_GETPRINTCOLOURMODE)
	End Method
	
	Method SciFindtext()
		SendEditor(SCI_FINDTEXT)
	End Method
	
	Method SciFormatrange()
		SendEditor(SCI_FORMATRANGE)
	End Method
	
	Method SciGetfirstvisibleline()
		SendEditor(SCI_GETFIRSTVISIBLELINE)
	End Method
	
	Method SciGetlinecount()
		SendEditor(SCI_GETLINECOUNT)
	End Method
	
	Method SciSetmarginleft()
		SendEditor(SCI_SETMARGINLEFT)
	End Method
	
	Method SciGetmarginleft()
		SendEditor(SCI_GETMARGINLEFT)
	End Method
	
	Method SciSetmarginright()
		SendEditor(SCI_SETMARGINRIGHT)
	End Method
	
	Method SciGetmarginright()
		SendEditor(SCI_GETMARGINRIGHT)
	End Method
	
	Method SciGetmodify()
		SendEditor(SCI_GETMODIFY)
	End Method
	
	Method SciSetsel()
		SendEditor(SCI_SETSEL)
	End Method
	
	Method SciGetseltext()
		SendEditor(SCI_GETSELTEXT)
	End Method
	
	Method SciGettextrange()
		SendEditor(SCI_GETTEXTRANGE)
	End Method
	
	Method SciHideselection()
		SendEditor(SCI_HIDESELECTION)
	End Method
	
	Method SciPointxfromposition()
		SendEditor(SCI_POINTXFROMPOSITION)
	End Method
	
	Method SciPointyfromposition()
		SendEditor(SCI_POINTYFROMPOSITION)
	End Method
	
	Method SciLinefromposition()
		SendEditor(SCI_LINEFROMPOSITION)
	End Method
	
	Method SciPositionfromline()
		SendEditor(SCI_POSITIONFROMLINE)
	End Method
	
	Method SciLinescroll()
		SendEditor(SCI_LINESCROLL)
	End Method
	
	Method SciScrollcaret()
		SendEditor(SCI_SCROLLCARET)
	End Method
	
	Method SciSetreadonly()
		SendEditor(SCI_SETREADONLY)
	End Method
	
	Method SciNull()
		SendEditor(SCI_NULL)
	End Method
	
	Method SciCanpaste()
		SendEditor(SCI_CANPASTE)
	End Method
	
	Method SciCanundo()
		SendEditor(SCI_CANUNDO)
	End Method
	
	Method SciEmptyundobuffer()
		SendEditor(SCI_EMPTYUNDOBUFFER)
	End Method
	
	Method SciUndo()
		SendEditor(SCI_UNDO)
	End Method
	
	Method SciCut()
		SendEditor(SCI_CUT)
	End Method
	
	Method SciCopy()
		SendEditor(SCI_COPY)
	End Method
	
	Method SciPaste()
		SendEditor(SCI_PASTE)
	End Method
	
	Method SciClear()
		SendEditor(SCI_CLEAR)
	End Method
		
	Method SciGettextlength()
		SendEditor(SCI_GETTEXTLENGTH)
	End Method
	
	Method SciGetdirectfunction()
		SendEditor(SCI_GETDIRECTFUNCTION)
	End Method
	
	Method SciGetdirectpointer()
		SendEditor(SCI_GETDIRECTPOINTER)
	End Method
	
	Method SciSetovertype()
		SendEditor(SCI_SETOVERTYPE)
	End Method
	
	Method SciGetovertype()
		SendEditor(SCI_GETOVERTYPE)
	End Method
	
	Method SciSetcaretwidth()
		SendEditor(SCI_SETCARETWIDTH)
	End Method
	
	Method SciGetcaretwidth()
		SendEditor(SCI_GETCARETWIDTH)
	End Method
	
	Method SciSettargetstart()
		SendEditor(SCI_SETTARGETSTART)
	End Method
	
	Method SciGettargetstart()
		SendEditor(SCI_GETTARGETSTART)
	End Method
	
	Method SciSettargetend()
		SendEditor(SCI_SETTARGETEND)
	End Method
	
	Method SciGettargetend()
		SendEditor(SCI_GETTARGETEND)
	End Method
	
	Method SciReplacetarget()
		SendEditor(SCI_REPLACETARGET)
	End Method
	
	Method SciReplacetargetre()
		SendEditor(SCI_REPLACETARGETRE)
	End Method
	
	Method SciSearchintarget()
		SendEditor(SCI_SEARCHINTARGET)
	End Method
	
	Method SciSetsearchflags()
		SendEditor(SCI_SETSEARCHFLAGS)
	End Method
	
	Method SciGetsearchflags()
		SendEditor(SCI_GETSEARCHFLAGS)
	End Method
	
	Method SciCalltipshow()
		SendEditor(SCI_CALLTIPSHOW)
	End Method
	
	Method SciCalltipcancel()
		SendEditor(SCI_CALLTIPCANCEL)
	End Method
	
	Method SciCalltipactive()
		SendEditor(SCI_CALLTIPACTIVE)
	End Method
	
	Method SciCalltipposstart()
		SendEditor(SCI_CALLTIPPOSSTART)
	End Method
	
	Method SciCalltipsethlt()
		SendEditor(SCI_CALLTIPSETHLT)
	End Method
	
	Method SciCalltipsetback()
		SendEditor(SCI_CALLTIPSETBACK)
	End Method
	
	Method SciCalltipsetfore()
		SendEditor(SCI_CALLTIPSETFORE)
	End Method
	
	Method SciCalltipsetforehlt()
		SendEditor(SCI_CALLTIPSETFOREHLT)
	End Method
	
	Method SciCalltipusestyle()
		SendEditor(SCI_CALLTIPUSESTYLE)
	End Method
	
	Method SciVisiblefromdocline()
		SendEditor(SCI_VISIBLEFROMDOCLINE)
	End Method
	
	Method SciDoclinefromvisible()
		SendEditor(SCI_DOCLINEFROMVISIBLE)
	End Method
	
	Method SciWrapcount()
		SendEditor(SCI_WRAPCOUNT)
	End Method
	
	Method SciSetfoldlevel()
		SendEditor(SCI_SETFOLDLEVEL)
	End Method
	
	Method SciGetfoldlevel()
		SendEditor(SCI_GETFOLDLEVEL)
	End Method
	
	Method SciGetlastchild()
		SendEditor(SCI_GETLASTCHILD)
	End Method
	
	Method SciGetfoldparent()
		SendEditor(SCI_GETFOLDPARENT)
	End Method
	
	Method SciShowlines()
		SendEditor(SCI_SHOWLINES)
	End Method
	
	Method SciHidelines()
		SendEditor(SCI_HIDELINES)
	End Method
	
	Method SciGetlinevisible()
		SendEditor(SCI_GETLINEVISIBLE)
	End Method
	
	Method SciSetfoldexpanded()
		SendEditor(SCI_SETFOLDEXPANDED)
	End Method
	
	Method SciGetfoldexpanded()
		SendEditor(SCI_GETFOLDEXPANDED)
	End Method
	
	Method SciTogglefold()
		SendEditor(SCI_TOGGLEFOLD)
	End Method
	
	Method SciEnsurevisible()
		SendEditor(SCI_ENSUREVISIBLE)
	End Method
	
	Method SciSetfoldflags()
		SendEditor(SCI_SETFOLDFLAGS)
	End Method
	
	Method SciEnsurevisibleenforcepolicy()
		SendEditor(SCI_ENSUREVISIBLEENFORCEPOLICY)
	End Method
	
	Method SciSettabindents()
		SendEditor(SCI_SETTABINDENTS)
	End Method
	
	Method SciGettabindents()
		SendEditor(SCI_GETTABINDENTS)
	End Method
	
	Method SciSetbackspaceunindents()
		SendEditor(SCI_SETBACKSPACEUNINDENTS)
	End Method
	
	Method SciGetbackspaceunindents()
		SendEditor(SCI_GETBACKSPACEUNINDENTS)
	End Method
	
	Method SciSetmousedwelltime()
		SendEditor(SCI_SETMOUSEDWELLTIME)
	End Method
	
	Method SciGetmousedwelltime()
		SendEditor(SCI_GETMOUSEDWELLTIME)
	End Method
	
	Method SciWordstartposition()
		SendEditor(SCI_WORDSTARTPOSITION)
	End Method
	
	Method SciWordendposition()
		SendEditor(SCI_WORDENDPOSITION)
	End Method
	
	Method SciSetwrapmode()
		SendEditor(SCI_SETWRAPMODE)
	End Method
	
	Method SciGetwrapmode()
		SendEditor(SCI_GETWRAPMODE)
	End Method
	
	Method SciSetwrapvisualflags()
		SendEditor(SCI_SETWRAPVISUALFLAGS)
	End Method
	
	Method SciGetwrapvisualflags()
		SendEditor(SCI_GETWRAPVISUALFLAGS)
	End Method
	
	Method SciSetwrapvisualflagslocation()
		SendEditor(SCI_SETWRAPVISUALFLAGSLOCATION)
	End Method
	
	Method SciGetwrapvisualflagslocation()
		SendEditor(SCI_GETWRAPVISUALFLAGSLOCATION)
	End Method
	
	Method SciSetwrapstartindent()
		SendEditor(SCI_SETWRAPSTARTINDENT)
	End Method
	
	Method SciGetwrapstartindent()
		SendEditor(SCI_GETWRAPSTARTINDENT)
	End Method
	
	Method SciSetwrapindentmode()
		SendEditor(SCI_SETWRAPINDENTMODE)
	End Method
	
	Method SciGetwrapindentmode()
		SendEditor(SCI_GETWRAPINDENTMODE)
	End Method
	
	Method SciSetlayoutcache()
		SendEditor(SCI_SETLAYOUTCACHE)
	End Method
	
	Method SciGetlayoutcache()
		SendEditor(SCI_GETLAYOUTCACHE)
	End Method
	
	Method SciSetscrollwidth()
		SendEditor(SCI_SETSCROLLWIDTH)
	End Method
	
	Method SciGetscrollwidth()
		SendEditor(SCI_GETSCROLLWIDTH)
	End Method
	
	Method SciSetscrollwidthtracking()
		SendEditor(SCI_SETSCROLLWIDTHTRACKING)
	End Method
	
	Method SciGetscrollwidthtracking()
		SendEditor(SCI_GETSCROLLWIDTHTRACKING)
	End Method
	
	Method SciTextwidth()
		SendEditor(SCI_TEXTWIDTH)
	End Method
	
	Method SciSetendatlastline()
		SendEditor(SCI_SETENDATLASTLINE)
	End Method
	
	Method SciGetendatlastline()
		SendEditor(SCI_GETENDATLASTLINE)
	End Method
	
	Method SciTextheight()
		SendEditor(SCI_TEXTHEIGHT)
	End Method
	
	Method SciSetvscrollbar()
		SendEditor(SCI_SETVSCROLLBAR)
	End Method
	
	Method SciGetvscrollbar()
		SendEditor(SCI_GETVSCROLLBAR)
	End Method
	
	Method SciAppendtext()
		SendEditor(SCI_APPENDTEXT)
	End Method
	
	Method SciGettwophasedraw()
		SendEditor(SCI_GETTWOPHASEDRAW)
	End Method
	
	Method SciSettwophasedraw()
		SendEditor(SCI_SETTWOPHASEDRAW)
	End Method
	
	Method SciTargetfromselection()
		SendEditor(SCI_TARGETFROMSELECTION)
	End Method
	
	Method SciLinesjoin()
		SendEditor(SCI_LINESJOIN)
	End Method
	
	Method SciLinessplit()
		SendEditor(SCI_LINESSPLIT)
	End Method
	
	Method SciSetfoldmargincolour()
		SendEditor(SCI_SETFOLDMARGINCOLOUR)
	End Method
	
	Method SciSetfoldmarginhicolour()
		SendEditor(SCI_SETFOLDMARGINHICOLOUR)
	End Method
	
	Method SciLinedown()
		SendEditor(SCI_LINEDOWN)
	End Method
	
	Method SciLinedownextend()
		SendEditor(SCI_LINEDOWNEXTEND)
	End Method
	
	Method SciLineup()
		SendEditor(SCI_LINEUP)
	End Method
	
	Method SciLineupextend()
		SendEditor(SCI_LINEUPEXTEND)
	End Method
	
	Method SciCharleft()
		SendEditor(SCI_CHARLEFT)
	End Method
	
	Method SciCharleftextend()
		SendEditor(SCI_CHARLEFTEXTEND)
	End Method
	
	Method SciCharright()
		SendEditor(SCI_CHARRIGHT)
	End Method
	
	Method SciCharrightextend()
		SendEditor(SCI_CHARRIGHTEXTEND)
	End Method
	
	Method SciWordleft()
		SendEditor(SCI_WORDLEFT)
	End Method
	
	Method SciWordleftextend()
		SendEditor(SCI_WORDLEFTEXTEND)
	End Method
	
	Method SciWordright()
		SendEditor(SCI_WORDRIGHT)
	End Method
	
	Method SciWordrightextend()
		SendEditor(SCI_WORDRIGHTEXTEND)
	End Method
	
	Method SciHome()
		SendEditor(SCI_HOME)
	End Method
	
	Method SciHomeextend()
		SendEditor(SCI_HOMEEXTEND)
	End Method
	
	Method SciLineend()
		SendEditor(SCI_LINEEND)
	End Method
	
	Method SciLineendextend()
		SendEditor(SCI_LINEENDEXTEND)
	End Method
	
	Method SciDocumentstart()
		SendEditor(SCI_DOCUMENTSTART)
	End Method
	
	Method SciDocumentstartextend()
		SendEditor(SCI_DOCUMENTSTARTEXTEND)
	End Method
	
	Method SciDocumentend()
		SendEditor(SCI_DOCUMENTEND)
	End Method
	
	Method SciDocumentendextend()
		SendEditor(SCI_DOCUMENTENDEXTEND)
	End Method
	
	Method SciPageup()
		SendEditor(SCI_PAGEUP)
	End Method
	
	Method SciPageupextend()
		SendEditor(SCI_PAGEUPEXTEND)
	End Method
	
	Method SciPagedown()
		SendEditor(SCI_PAGEDOWN)
	End Method
	
	Method SciPagedownextend()
		SendEditor(SCI_PAGEDOWNEXTEND)
	End Method
	
	Method SciEdittoggleovertype()
		SendEditor(SCI_EDITTOGGLEOVERTYPE)
	End Method
	
	Method SciCancel()
		SendEditor(SCI_CANCEL)
	End Method
	
	Method SciDeleteback()
		SendEditor(SCI_DELETEBACK)
	End Method
	
	Method SciTab()
		SendEditor(SCI_TAB)
	End Method
	
	Method SciBacktab()
		SendEditor(SCI_BACKTAB)
	End Method
	
	Method SciNewline()
		SendEditor(SCI_NEWLINE)
	End Method
	
	Method SciFormfeed()
		SendEditor(SCI_FORMFEED)
	End Method
	
	Method SciVchome()
		SendEditor(SCI_VCHOME)
	End Method
	
	Method SciVchomeextend()
		SendEditor(SCI_VCHOMEEXTEND)
	End Method
	
	Method SciZoomin()
		SendEditor(SCI_ZOOMIN)
	End Method
	
	Method SciZoomout()
		SendEditor(SCI_ZOOMOUT)
	End Method
	
	Method SciDelwordleft()
		SendEditor(SCI_DELWORDLEFT)
	End Method
	
	Method SciDelwordright()
		SendEditor(SCI_DELWORDRIGHT)
	End Method
	
	Method SciDelwordrightend()
		SendEditor(SCI_DELWORDRIGHTEND)
	End Method
	
	Method SciLinecut()
		SendEditor(SCI_LINECUT)
	End Method
	
	Method SciLinedelete()
		SendEditor(SCI_LINEDELETE)
	End Method
	
	Method SciLinetranspose()
		SendEditor(SCI_LINETRANSPOSE)
	End Method
	
	Method SciLineduplicate()
		SendEditor(SCI_LINEDUPLICATE)
	End Method
	
	Method SciLowercase()
		SendEditor(SCI_LOWERCASE)
	End Method
	
	Method SciUppercase()
		SendEditor(SCI_UPPERCASE)
	End Method
	
	Method SciLinescrolldown()
		SendEditor(SCI_LINESCROLLDOWN)
	End Method
	
	Method SciLinescrollup()
		SendEditor(SCI_LINESCROLLUP)
	End Method
	
	Method SciDeletebacknotline()
		SendEditor(SCI_DELETEBACKNOTLINE)
	End Method
	
	Method SciHomedisplay()
		SendEditor(SCI_HOMEDISPLAY)
	End Method
	
	Method SciHomedisplayextend()
		SendEditor(SCI_HOMEDISPLAYEXTEND)
	End Method
	
	Method SciLineenddisplay()
		SendEditor(SCI_LINEENDDISPLAY)
	End Method
	
	Method SciLineenddisplayextend()
		SendEditor(SCI_LINEENDDISPLAYEXTEND)
	End Method
	
	Method SciHomewrap()
		SendEditor(SCI_HOMEWRAP)
	End Method
	
	Method SciHomewrapextend()
		SendEditor(SCI_HOMEWRAPEXTEND)
	End Method
	
	Method SciLineendwrap()
		SendEditor(SCI_LINEENDWRAP)
	End Method
	
	Method SciLineendwrapextend()
		SendEditor(SCI_LINEENDWRAPEXTEND)
	End Method
	
	Method SciVchomewrap()
		SendEditor(SCI_VCHOMEWRAP)
	End Method
	
	Method SciVchomewrapextend()
		SendEditor(SCI_VCHOMEWRAPEXTEND)
	End Method
	
	Method SciLinecopy()
		SendEditor(SCI_LINECOPY)
	End Method
	
	Method SciMovecaretinsideview()
		SendEditor(SCI_MOVECARETINSIDEVIEW)
	End Method
	
	Method SciLinelength()
		SendEditor(SCI_LINELENGTH)
	End Method
	
	Method SciBracehighlight()
		SendEditor(SCI_BRACEHIGHLIGHT)
	End Method
	
	Method SciBracebadlight()
		SendEditor(SCI_BRACEBADLIGHT)
	End Method
	
	Method SciBracematch()
		SendEditor(SCI_BRACEMATCH)
	End Method
	
	Method SciGetvieweol()
		SendEditor(SCI_GETVIEWEOL)
	End Method
	
	Method SciSetvieweol()
		SendEditor(SCI_SETVIEWEOL)
	End Method
	
	Method SciGetdocpointer()
		SendEditor(SCI_GETDOCPOINTER)
	End Method
	
	Method SciSetdocpointer()
		SendEditor(SCI_SETDOCPOINTER)
	End Method
	
	Method SciSetmodeventmask()
		SendEditor(SCI_SETMODEVENTMASK)
	End Method
	
	Method SciGetedgecolumn()
		SendEditor(SCI_GETEDGECOLUMN)
	End Method
	
	Method SciSetedgecolumn()
		SendEditor(SCI_SETEDGECOLUMN)
	End Method
	
	Method SciGetedgemode()
		SendEditor(SCI_GETEDGEMODE)
	End Method
	
	Method SciSetedgemode()
		SendEditor(SCI_SETEDGEMODE)
	End Method
	
	Method SciGetedgecolour()
		SendEditor(SCI_GETEDGECOLOUR)
	End Method
	
	Method SciSetedgecolour()
		SendEditor(SCI_SETEDGECOLOUR)
	End Method
	
	Method SciSearchanchor()
		SendEditor(SCI_SEARCHANCHOR)
	End Method
	
	Method SciSearchnext()
		SendEditor(SCI_SEARCHNEXT)
	End Method
	
	Method SciSearchprev()
		SendEditor(SCI_SEARCHPREV)
	End Method
	
	Method SciLinesonscreen()
		SendEditor(SCI_LINESONSCREEN)
	End Method
	
	Method SciUsepopup()
		SendEditor(SCI_USEPOPUP)
	End Method
	
	Method SciSelectionisrectangle()
		SendEditor(SCI_SELECTIONISRECTANGLE)
	End Method
	
	Method SciSetzoom()
		SendEditor(SCI_SETZOOM)
	End Method
	
	Method SciGetzoom()
		SendEditor(SCI_GETZOOM)
	End Method
	
	Method SciCreatedocument()
		SendEditor(SCI_CREATEDOCUMENT)
	End Method
	
	Method SciAddrefdocument()
		SendEditor(SCI_ADDREFDOCUMENT)
	End Method
	
	Method SciReleasedocument()
		SendEditor(SCI_RELEASEDOCUMENT)
	End Method
	
	Method SciGetmodeventmask()
		SendEditor(SCI_GETMODEVENTMASK)
	End Method
	
	Method SciSetfocus()
		SendEditor(SCI_SETFOCUS)
	End Method
	
	Method SciGetfocus()
		SendEditor(SCI_GETFOCUS)
	End Method
	
	Method SciSetstatus()
		SendEditor(SCI_SETSTATUS)
	End Method
	
	Method SciGetstatus()
		SendEditor(SCI_GETSTATUS)
	End Method
	
	Method SciSetmousedowncaptures()
		SendEditor(SCI_SETMOUSEDOWNCAPTURES)
	End Method
	
	Method SciGetmousedowncaptures()
		SendEditor(SCI_GETMOUSEDOWNCAPTURES)
	End Method
	
	Method SciSetcursor()
		SendEditor(SCI_SETCURSOR)
	End Method
	
	Method SciGetcursor()
		SendEditor(SCI_GETCURSOR)
	End Method
	
	Method SciSetcontrolcharsymbol()
		SendEditor(SCI_SETCONTROLCHARSYMBOL)
	End Method
	
	Method SciGetcontrolcharsymbol()
		SendEditor(SCI_GETCONTROLCHARSYMBOL)
	End Method
	
	Method SciWordpartleft()
		SendEditor(SCI_WORDPARTLEFT)
	End Method
	
	Method SciWordpartleftextend()
		SendEditor(SCI_WORDPARTLEFTEXTEND)
	End Method
	
	Method SciWordpartright()
		SendEditor(SCI_WORDPARTRIGHT)
	End Method
	
	Method SciWordpartrightextend()
		SendEditor(SCI_WORDPARTRIGHTEXTEND)
	End Method
	
	Method SciSetvisiblepolicy()
		SendEditor(SCI_SETVISIBLEPOLICY)
	End Method
	
	Method SciDellineleft()
		SendEditor(SCI_DELLINELEFT)
	End Method
	
	Method SciDellineright()
		SendEditor(SCI_DELLINERIGHT)
	End Method
	
	Method SciSetxoffset()
		SendEditor(SCI_SETXOFFSET)
	End Method
	
	Method SciGetxoffset()
		SendEditor(SCI_GETXOFFSET)
	End Method
	
	Method SciChoosecaretx()
		SendEditor(SCI_CHOOSECARETX)
	End Method
	
	Method SciGrabfocus()
		SendEditor(SCI_GRABFOCUS)
	End Method
	
	Method SciSetxcaretpolicy()
		SendEditor(SCI_SETXCARETPOLICY)
	End Method
	
	Method SciSetycaretpolicy()
		SendEditor(SCI_SETYCARETPOLICY)
	End Method
	
	Method SciSetprintwrapmode()
		SendEditor(SCI_SETPRINTWRAPMODE)
	End Method
	
	Method SciGetprintwrapmode()
		SendEditor(SCI_GETPRINTWRAPMODE)
	End Method
	
	Method SciSethotspotactivefore()
		SendEditor(SCI_SETHOTSPOTACTIVEFORE)
	End Method
	
	Method SciGethotspotactivefore()
		SendEditor(SCI_GETHOTSPOTACTIVEFORE)
	End Method
	
	Method SciSethotspotactiveback()
		SendEditor(SCI_SETHOTSPOTACTIVEBACK)
	End Method
	
	Method SciGethotspotactiveback()
		SendEditor(SCI_GETHOTSPOTACTIVEBACK)
	End Method
	
	Method SciSethotspotactiveunderline()
		SendEditor(SCI_SETHOTSPOTACTIVEUNDERLINE)
	End Method
	
	Method SciGethotspotactiveunderline()
		SendEditor(SCI_GETHOTSPOTACTIVEUNDERLINE)
	End Method
	
	Method SciSethotspotsingleline()
		SendEditor(SCI_SETHOTSPOTSINGLELINE)
	End Method
	
	Method SciGethotspotsingleline()
		SendEditor(SCI_GETHOTSPOTSINGLELINE)
	End Method
	
	Method SciParadown()
		SendEditor(SCI_PARADOWN)
	End Method
	
	Method SciParadownextend()
		SendEditor(SCI_PARADOWNEXTEND)
	End Method
	
	Method SciParaup()
		SendEditor(SCI_PARAUP)
	End Method
	
	Method SciParaupextend()
		SendEditor(SCI_PARAUPEXTEND)
	End Method
	
	Method SciPositionbefore()
		SendEditor(SCI_POSITIONBEFORE)
	End Method
	
	Method SciPositionafter()
		SendEditor(SCI_POSITIONAFTER)
	End Method
	
	Method SciCopyrange()
		SendEditor(SCI_COPYRANGE)
	End Method
	
	Method SciCopytext()
		SendEditor(SCI_COPYTEXT)
	End Method
	
	Method SciSetselectionmode()
		SendEditor(SCI_SETSELECTIONMODE)
	End Method
	
	Method SciGetselectionmode()
		SendEditor(SCI_GETSELECTIONMODE)
	End Method
	
	Method SciGetlineselstartposition()
		SendEditor(SCI_GETLINESELSTARTPOSITION)
	End Method
	
	Method SciGetlineselendposition()
		SendEditor(SCI_GETLINESELENDPOSITION)
	End Method
	
	Method SciLinedownrectextend()
		SendEditor(SCI_LINEDOWNRECTEXTEND)
	End Method
	
	Method SciLineuprectextend()
		SendEditor(SCI_LINEUPRECTEXTEND)
	End Method
	
	Method SciCharleftrectextend()
		SendEditor(SCI_CHARLEFTRECTEXTEND)
	End Method
	
	Method SciCharrightrectextend()
		SendEditor(SCI_CHARRIGHTRECTEXTEND)
	End Method
	
	Method SciHomerectextend()
		SendEditor(SCI_HOMERECTEXTEND)
	End Method
	
	Method SciVchomerectextend()
		SendEditor(SCI_VCHOMERECTEXTEND)
	End Method
	
	Method SciLineendrectextend()
		SendEditor(SCI_LINEENDRECTEXTEND)
	End Method
	
	Method SciPageuprectextend()
		SendEditor(SCI_PAGEUPRECTEXTEND)
	End Method
	
	Method SciPagedownrectextend()
		SendEditor(SCI_PAGEDOWNRECTEXTEND)
	End Method
	
	Method SciStutteredpageup()
		SendEditor(SCI_STUTTEREDPAGEUP)
	End Method
	
	Method SciStutteredpageupextend()
		SendEditor(SCI_STUTTEREDPAGEUPEXTEND)
	End Method
	
	Method SciStutteredpagedown()
		SendEditor(SCI_STUTTEREDPAGEDOWN)
	End Method
	
	Method SciStutteredpagedownextend()
		SendEditor(SCI_STUTTEREDPAGEDOWNEXTEND)
	End Method
	
	Method SciWordleftend()
		SendEditor(SCI_WORDLEFTEND)
	End Method
	
	Method SciWordleftendextend()
		SendEditor(SCI_WORDLEFTENDEXTEND)
	End Method
	
	Method SciWordrightend()
		SendEditor(SCI_WORDRIGHTEND)
	End Method
	
	Method SciWordrightendextend()
		SendEditor(SCI_WORDRIGHTENDEXTEND)
	End Method
	
	Method SciSetwhitespacechars()
		SendEditor(SCI_SETWHITESPACECHARS)
	End Method
	
	Method SciSetcharsdefault()
		SendEditor(SCI_SETCHARSDEFAULT)
	End Method
	
	Method SciAutocgetcurrent()
		SendEditor(SCI_AUTOCGETCURRENT)
	End Method
	
	Method SciAllocate()
		SendEditor(SCI_ALLOCATE)
	End Method
	
	Method SciTargetasutf8()
		SendEditor(SCI_TARGETASUTF8)
	End Method
	
	Method SciSetlengthforencode()
		SendEditor(SCI_SETLENGTHFORENCODE)
	End Method
	
	Method SciEncodedfromutf8()
		SendEditor(SCI_ENCODEDFROMUTF8)
	End Method
	
	Method SciFindcolumn()
		SendEditor(SCI_FINDCOLUMN)
	End Method
	
	Method SciGetcaretsticky()
		SendEditor(SCI_GETCARETSTICKY)
	End Method
	
	Method SciSetcaretsticky()
		SendEditor(SCI_SETCARETSTICKY)
	End Method
	
	Method SciTogglecaretsticky()
		SendEditor(SCI_TOGGLECARETSTICKY)
	End Method
	
	Method SciSetpasteconvertendings()
		SendEditor(SCI_SETPASTECONVERTENDINGS)
	End Method
	
	Method SciGetpasteconvertendings()
		SendEditor(SCI_GETPASTECONVERTENDINGS)
	End Method
	
	Method SciSelectionduplicate()
		SendEditor(SCI_SELECTIONDUPLICATE)
	End Method
	
	Method SciSetcaretlinebackalpha()
		SendEditor(SCI_SETCARETLINEBACKALPHA)
	End Method
	
	Method SciGetcaretlinebackalpha()
		SendEditor(SCI_GETCARETLINEBACKALPHA)
	End Method
	
	Method SciSetcaretstyle()
		SendEditor(SCI_SETCARETSTYLE)
	End Method
	
	Method SciGetcaretstyle()
		SendEditor(SCI_GETCARETSTYLE)
	End Method
	
	Method SciSetindicatorcurrent()
		SendEditor(SCI_SETINDICATORCURRENT)
	End Method
	
	Method SciGetindicatorcurrent()
		SendEditor(SCI_GETINDICATORCURRENT)
	End Method
	
	Method SciSetindicatorvalue()
		SendEditor(SCI_SETINDICATORVALUE)
	End Method
	
	Method SciGetindicatorvalue()
		SendEditor(SCI_GETINDICATORVALUE)
	End Method
	
	Method SciIndicatorfillrange()
		SendEditor(SCI_INDICATORFILLRANGE)
	End Method
	
	Method SciIndicatorclearrange()
		SendEditor(SCI_INDICATORCLEARRANGE)
	End Method
	
	Method SciIndicatorallonfor()
		SendEditor(SCI_INDICATORALLONFOR)
	End Method
	
	Method SciIndicatorvalueat()
		SendEditor(SCI_INDICATORVALUEAT)
	End Method
	
	Method SciIndicatorstart()
		SendEditor(SCI_INDICATORSTART)
	End Method
	
	Method SciIndicatorend()
		SendEditor(SCI_INDICATOREND)
	End Method
	
	Method SciSetpositioncache()
		SendEditor(SCI_SETPOSITIONCACHE)
	End Method
	
	Method SciGetpositioncache()
		SendEditor(SCI_GETPOSITIONCACHE)
	End Method
	
	Method SciCopyallowline()
		SendEditor(SCI_COPYALLOWLINE)
	End Method
	
	Method SciGetcharacterpointer()
		SendEditor(SCI_GETCHARACTERPOINTER)
	End Method
	
	Method SciSetkeysunicode()
		SendEditor(SCI_SETKEYSUNICODE)
	End Method
	
	Method SciGetkeysunicode()
		SendEditor(SCI_GETKEYSUNICODE)
	End Method
	
	Method SciIndicsetalpha()
		SendEditor(SCI_INDICSETALPHA)
	End Method
	
	Method SciIndicgetalpha()
		SendEditor(SCI_INDICGETALPHA)
	End Method
	
	Method SciSetextraascent()
		SendEditor(SCI_SETEXTRAASCENT)
	End Method
	
	Method SciGetextraascent()
		SendEditor(SCI_GETEXTRAASCENT)
	End Method
	
	Method SciSetextradescent()
		SendEditor(SCI_SETEXTRADESCENT)
	End Method
	
	Method SciGetextradescent()
		SendEditor(SCI_GETEXTRADESCENT)
	End Method
	
	Method SciMarkersymboldefined()
		SendEditor(SCI_MARKERSYMBOLDEFINED)
	End Method
	
	Method SciMarginsettext()
		SendEditor(SCI_MARGINSETTEXT)
	End Method
	
	Method SciMargingettext()
		SendEditor(SCI_MARGINGETTEXT)
	End Method
	
	Method SciMarginsetstyle()
		SendEditor(SCI_MARGINSETSTYLE)
	End Method
	
	Method SciMargingetstyle()
		SendEditor(SCI_MARGINGETSTYLE)
	End Method
	
	Method SciMarginsetstyles()
		SendEditor(SCI_MARGINSETSTYLES)
	End Method
	
	Method SciMargingetstyles()
		SendEditor(SCI_MARGINGETSTYLES)
	End Method
	
	Method SciMargintextclearall()
		SendEditor(SCI_MARGINTEXTCLEARALL)
	End Method
	
	Method SciMarginsetstyleoffset()
		SendEditor(SCI_MARGINSETSTYLEOFFSET)
	End Method
	
	Method SciMargingetstyleoffset()
		SendEditor(SCI_MARGINGETSTYLEOFFSET)
	End Method
	
	Method SciAnnotationsettext()
		SendEditor(SCI_ANNOTATIONSETTEXT)
	End Method
	
	Method SciAnnotationgettext()
		SendEditor(SCI_ANNOTATIONGETTEXT)
	End Method
	
	Method SciAnnotationsetstyle()
		SendEditor(SCI_ANNOTATIONSETSTYLE)
	End Method
	
	Method SciAnnotationgetstyle()
		SendEditor(SCI_ANNOTATIONGETSTYLE)
	End Method
	
	Method SciAnnotationsetstyles()
		SendEditor(SCI_ANNOTATIONSETSTYLES)
	End Method
	
	Method SciAnnotationgetstyles()
		SendEditor(SCI_ANNOTATIONGETSTYLES)
	End Method
	
	Method SciAnnotationgetlines()
		SendEditor(SCI_ANNOTATIONGETLINES)
	End Method
	
	Method SciAnnotationclearall()
		SendEditor(SCI_ANNOTATIONCLEARALL)
	End Method
	
	Method SciAnnotationsetvisible()
		SendEditor(SCI_ANNOTATIONSETVISIBLE)
	End Method
	
	Method SciAnnotationgetvisible()
		SendEditor(SCI_ANNOTATIONGETVISIBLE)
	End Method
	
	Method SciAnnotationsetstyleoffset()
		SendEditor(SCI_ANNOTATIONSETSTYLEOFFSET)
	End Method
	
	Method SciAnnotationgetstyleoffset()
		SendEditor(SCI_ANNOTATIONGETSTYLEOFFSET)
	End Method
	
	Method SciAddundoaction()
		SendEditor(SCI_ADDUNDOACTION)
	End Method
	
	Method SciCharpositionfrompoint()
		SendEditor(SCI_CHARPOSITIONFROMPOINT)
	End Method
	
	Method SciCharpositionfrompointclose()
		SendEditor(SCI_CHARPOSITIONFROMPOINTCLOSE)
	End Method
	
	Method SciStartrecord()
		SendEditor(SCI_STARTRECORD)
	End Method
	
	Method SciStoprecord()
		SendEditor(SCI_STOPRECORD)
	End Method
	
	Method SciSetlexer()
		SendEditor(SCI_SETLEXER)
	End Method
	
	Method SciGetlexer()
		SendEditor(SCI_GETLEXER)
	End Method
	
	Method SciColourise()
		SendEditor(SCI_COLOURISE)
	End Method
	
	Method SciSetproperty()
		SendEditor(SCI_SETPROPERTY)
	End Method
	
	Method SciSetkeywords()
		SendEditor(SCI_SETKEYWORDS)
	End Method
	
	Method SciSetlexerlanguage()
		SendEditor(SCI_SETLEXERLANGUAGE)
	End Method
	
	Method SciLoadlexerlibrary()
		SendEditor(SCI_LOADLEXERLIBRARY)
	End Method
	
	Method SciGetproperty()
		SendEditor(SCI_GETPROPERTY)
	End Method
	
	Method SciGetpropertyexpanded()
		SendEditor(SCI_GETPROPERTYEXPANDED)
	End Method
	
	Method SciGetpropertyint()
		SendEditor(SCI_GETPROPERTYINT)
	End Method
	
	Method SciGetstylebitsneeded()
		SendEditor(SCI_GETSTYLEBITSNEEDED)
	End Method

End Type

Function EncodeColor:Int(ColorR:Byte , ColorG:Byte , ColorB:Byte)	
	Return ColorR + (ColorG Shl 8) + (ColorB Shl 16)
End Function

Function CreateScintillaArea:TScintillaGadget(x:Int = 0 , y:Int = 0 , w:Int = - 1 , h:Int = - 1 , group:TGadget = Null , flags:Int = 0)
	Return TScintillaGadget.Create(x , y , w , h , group , flags)
End Function